3.7.100 \(\int \frac {(d \tan (e+f x))^n}{a+b \tan (e+f x)} \, dx\) [700]

Optimal. Leaf size=181 \[ \frac {a \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{1+n}}{\left (a^2+b^2\right ) d f (1+n)}+\frac {b^2 \, _2F_1\left (1,1+n;2+n;-\frac {b \tan (e+f x)}{a}\right ) (d \tan (e+f x))^{1+n}}{a \left (a^2+b^2\right ) d f (1+n)}-\frac {b \, _2F_1\left (1,\frac {2+n}{2};\frac {4+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{2+n}}{\left (a^2+b^2\right ) d^2 f (2+n)} \]

[Out]

a*hypergeom([1, 1/2+1/2*n],[3/2+1/2*n],-tan(f*x+e)^2)*(d*tan(f*x+e))^(1+n)/(a^2+b^2)/d/f/(1+n)+b^2*hypergeom([
1, 1+n],[2+n],-b*tan(f*x+e)/a)*(d*tan(f*x+e))^(1+n)/a/(a^2+b^2)/d/f/(1+n)-b*hypergeom([1, 1+1/2*n],[2+1/2*n],-
tan(f*x+e)^2)*(d*tan(f*x+e))^(2+n)/(a^2+b^2)/d^2/f/(2+n)

________________________________________________________________________________________

Rubi [A]
time = 0.19, antiderivative size = 181, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3655, 3619, 3557, 371, 3715, 66} \begin {gather*} -\frac {b (d \tan (e+f x))^{n+2} \, _2F_1\left (1,\frac {n+2}{2};\frac {n+4}{2};-\tan ^2(e+f x)\right )}{d^2 f (n+2) \left (a^2+b^2\right )}+\frac {a (d \tan (e+f x))^{n+1} \, _2F_1\left (1,\frac {n+1}{2};\frac {n+3}{2};-\tan ^2(e+f x)\right )}{d f (n+1) \left (a^2+b^2\right )}+\frac {b^2 (d \tan (e+f x))^{n+1} \, _2F_1\left (1,n+1;n+2;-\frac {b \tan (e+f x)}{a}\right )}{a d f (n+1) \left (a^2+b^2\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d*Tan[e + f*x])^n/(a + b*Tan[e + f*x]),x]

[Out]

(a*Hypergeometric2F1[1, (1 + n)/2, (3 + n)/2, -Tan[e + f*x]^2]*(d*Tan[e + f*x])^(1 + n))/((a^2 + b^2)*d*f*(1 +
 n)) + (b^2*Hypergeometric2F1[1, 1 + n, 2 + n, -((b*Tan[e + f*x])/a)]*(d*Tan[e + f*x])^(1 + n))/(a*(a^2 + b^2)
*d*f*(1 + n)) - (b*Hypergeometric2F1[1, (2 + n)/2, (4 + n)/2, -Tan[e + f*x]^2]*(d*Tan[e + f*x])^(2 + n))/((a^2
 + b^2)*d^2*f*(2 + n))

Rule 66

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[c^n*((b*x)^(m + 1)/(b*(m + 1)))*Hypergeometr
ic2F1[-n, m + 1, m + 2, (-d)*(x/c)], x] /; FreeQ[{b, c, d, m, n}, x] &&  !IntegerQ[m] && (IntegerQ[n] || (GtQ[
c, 0] &&  !(EqQ[n, -2^(-1)] && EqQ[c^2 - d^2, 0] && GtQ[-d/(b*c), 0])))

Rule 371

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*((c*x)^(m + 1)/(c*(m + 1)))*Hyperg
eometric2F1[-p, (m + 1)/n, (m + 1)/n + 1, (-b)*(x^n/a)], x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rule 3557

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[b/d, Subst[Int[x^n/(b^2 + x^2), x], x, b*Tan[c + d
*x]], x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rule 3619

Int[((b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*T
an[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Tan[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x] && NeQ
[c^2 + d^2, 0] &&  !IntegerQ[2*m]

Rule 3655

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)/((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[1/
(c^2 + d^2), Int[(a + b*Tan[e + f*x])^m*(c - d*Tan[e + f*x]), x], x] + Dist[d^2/(c^2 + d^2), Int[(a + b*Tan[e
+ f*x])^m*((1 + Tan[e + f*x]^2)/(c + d*Tan[e + f*x])), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c -
a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] &&  !IntegerQ[m]

Rule 3715

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_) + (C_.)*
tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[A/f, Subst[Int[(a + b*x)^m*(c + d*x)^n, x], x, Tan[e + f*x]], x]
 /; FreeQ[{a, b, c, d, e, f, A, C, m, n}, x] && EqQ[A, C]

Rubi steps

\begin {align*} \int \frac {(d \tan (e+f x))^n}{a+b \tan (e+f x)} \, dx &=\frac {\int (d \tan (e+f x))^n (a-b \tan (e+f x)) \, dx}{a^2+b^2}+\frac {b^2 \int \frac {(d \tan (e+f x))^n \left (1+\tan ^2(e+f x)\right )}{a+b \tan (e+f x)} \, dx}{a^2+b^2}\\ &=\frac {a \int (d \tan (e+f x))^n \, dx}{a^2+b^2}-\frac {b \int (d \tan (e+f x))^{1+n} \, dx}{\left (a^2+b^2\right ) d}+\frac {b^2 \text {Subst}\left (\int \frac {(d x)^n}{a+b x} \, dx,x,\tan (e+f x)\right )}{\left (a^2+b^2\right ) f}\\ &=\frac {b^2 \, _2F_1\left (1,1+n;2+n;-\frac {b \tan (e+f x)}{a}\right ) (d \tan (e+f x))^{1+n}}{a \left (a^2+b^2\right ) d f (1+n)}-\frac {b \text {Subst}\left (\int \frac {x^{1+n}}{d^2+x^2} \, dx,x,d \tan (e+f x)\right )}{\left (a^2+b^2\right ) f}+\frac {(a d) \text {Subst}\left (\int \frac {x^n}{d^2+x^2} \, dx,x,d \tan (e+f x)\right )}{\left (a^2+b^2\right ) f}\\ &=\frac {a \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{1+n}}{\left (a^2+b^2\right ) d f (1+n)}+\frac {b^2 \, _2F_1\left (1,1+n;2+n;-\frac {b \tan (e+f x)}{a}\right ) (d \tan (e+f x))^{1+n}}{a \left (a^2+b^2\right ) d f (1+n)}-\frac {b \, _2F_1\left (1,\frac {2+n}{2};\frac {4+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{2+n}}{\left (a^2+b^2\right ) d^2 f (2+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.53, size = 142, normalized size = 0.78 \begin {gather*} \frac {\tan (e+f x) (d \tan (e+f x))^n \left (a^2 (2+n) \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\tan ^2(e+f x)\right )+b \left (b (2+n) \, _2F_1\left (1,1+n;2+n;-\frac {b \tan (e+f x)}{a}\right )-a (1+n) \, _2F_1\left (1,\frac {2+n}{2};\frac {4+n}{2};-\tan ^2(e+f x)\right ) \tan (e+f x)\right )\right )}{a \left (a^2+b^2\right ) f (1+n) (2+n)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d*Tan[e + f*x])^n/(a + b*Tan[e + f*x]),x]

[Out]

(Tan[e + f*x]*(d*Tan[e + f*x])^n*(a^2*(2 + n)*Hypergeometric2F1[1, (1 + n)/2, (3 + n)/2, -Tan[e + f*x]^2] + b*
(b*(2 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, -((b*Tan[e + f*x])/a)] - a*(1 + n)*Hypergeometric2F1[1, (2 + n)/
2, (4 + n)/2, -Tan[e + f*x]^2]*Tan[e + f*x])))/(a*(a^2 + b^2)*f*(1 + n)*(2 + n))

________________________________________________________________________________________

Maple [F]
time = 0.52, size = 0, normalized size = 0.00 \[\int \frac {\left (d \tan \left (f x +e \right )\right )^{n}}{a +b \tan \left (f x +e \right )}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*tan(f*x+e))^n/(a+b*tan(f*x+e)),x)

[Out]

int((d*tan(f*x+e))^n/(a+b*tan(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*tan(f*x+e))^n/(a+b*tan(f*x+e)),x, algorithm="maxima")

[Out]

integrate((d*tan(f*x + e))^n/(b*tan(f*x + e) + a), x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*tan(f*x+e))^n/(a+b*tan(f*x+e)),x, algorithm="fricas")

[Out]

integral((d*tan(f*x + e))^n/(b*tan(f*x + e) + a), x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (d \tan {\left (e + f x \right )}\right )^{n}}{a + b \tan {\left (e + f x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*tan(f*x+e))**n/(a+b*tan(f*x+e)),x)

[Out]

Integral((d*tan(e + f*x))**n/(a + b*tan(e + f*x)), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*tan(f*x+e))^n/(a+b*tan(f*x+e)),x, algorithm="giac")

[Out]

integrate((d*tan(f*x + e))^n/(b*tan(f*x + e) + a), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (d\,\mathrm {tan}\left (e+f\,x\right )\right )}^n}{a+b\,\mathrm {tan}\left (e+f\,x\right )} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*tan(e + f*x))^n/(a + b*tan(e + f*x)),x)

[Out]

int((d*tan(e + f*x))^n/(a + b*tan(e + f*x)), x)

________________________________________________________________________________________